package feizhou.untils.tools;


/**
 * 描述：Object to Map
 *
 * @author： feizhou
 * @date ：2018/12/21 15:39
 * @return Map
 */
public class ClassUtil {


    /**
     * 值的基本类型转换
     *
     * @return
     * @author <a href="920786312@qq.com">周飞</a>
     * @since 2023/9/16 19:27
     */
    public static Object convertValueType(Object value, Class<?> clazz) {


        if (clazz == String.class) {
            return String.valueOf(value);
        }
        if (clazz == Boolean.class) {
            return Boolean.valueOf(value.toString());
        }
        if (clazz == Integer.class) {
            return Integer.valueOf(value.toString());
        }
        if (clazz == Long.class) {
            return Long.valueOf(value.toString());
        }
        return value;
    }


}
